Non-volatile semiconductor memory is a type of memory that retains the stored contents even when the power is switched off. Although erasing is required before recording new data, this type of semiconductor memory is highly resistant to vibration and quiet since it is not mechanically driven or rotated. In addition, a recent increase in recording density offers an increase in capacity of semiconductor memory. Because of these advantages, non-volatile semiconductor memory is becoming increasingly common as a suitable information recording medium along with CDs (Compact Discs), DVDs (Digital Versatile Discs), and the like.
Among various types of semiconductor memory, flash memory is a later form of EEPROM (Electrically Erasable Programmable Read Only Memory) which must be erased byte-wise. Since it is erasable in blocks all at once, flash memory is now widely used in form of commercially available products, such as SD memory cards, for storing images taken by a digital camera.
A file system is used to manage data on various types of recording mediums including flash memory. Some of the common file systems are: FAT (File Allocation Table, Standard ECMA-107: Volume and File Structure of Disk Cartridges for Information Interchange); NTFS (New Technology File System); and UDF (Universal Disk Format). Through the use of a file system, video and audio data organized as files are concurrently recorded or reproduced.
According to a FAT file system, memory allocation and file management are carried out in units called clusters.
It should be noted that at least one cluster is occupied by a file no matter how small the file data may be. Thus, the lager the cluster size is, the lower the capacity efficiency of the memory becomes. On the other hand, the larger the block size is, the higher the memory density becomes. In view of the above, the block size is normally larger than the cluster size.
In addition, in the case where one cluster extends over two blocks, both the blocks need to be erased before recording data into the cluster. One technique for avoiding such an occurrence is disclosed in JP patent application publication No. 2001-188701. According to the disclosure, the file system is allowed to simply erase a block of flash memory if clusters belonging to that block are all free, and then to perform a data write.
Unfortunately, however, if the block includes any cluster storing data of an existing file, a series of operations (correctively called a Read-Modify-Write operation, hereinafter “RMW operation”) needs to be performed. The RMW operation is composed of: reading, before erasing a block, data stored in the block to a temporary memory on the main storage; deleting contents of the block; modifying the data on the temporary memory to reflect changes made to the file; and writing back contents of the temporary memory. That is, the RMW operation involves extra operations of the reading and modifying.
In addition, the series of operations is required each time data is written to the same block. Suppose a large volume of consecutive data such as video and audio data is to be written. In such a case, the series of operations needs to be repeated on the same blocks and thus the same set of data is read out and written back over and over, which requires a long processing time.